<?php

/**
 * memberpassword filter form base class.
 *
 * @package    sf_sandbox
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BasememberpasswordFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'ClassName'          => new sfWidgetFormChoice(array('choices' => array('' => '', 'MemberPassword' => 'MemberPassword'))),
      'Created'            => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'LastEdited'         => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'Password'           => new sfWidgetFormFilterInput(),
      'Salt'               => new sfWidgetFormFilterInput(),
      'PasswordEncryption' => new sfWidgetFormFilterInput(),
      'MemberID'           => new sfWidgetFormFilterInput(array('with_empty' => false)),
    ));

    $this->setValidators(array(
      'ClassName'          => new sfValidatorChoice(array('required' => false, 'choices' => array('MemberPassword' => 'MemberPassword'))),
      'Created'            => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'LastEdited'         => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'Password'           => new sfValidatorPass(array('required' => false)),
      'Salt'               => new sfValidatorPass(array('required' => false)),
      'PasswordEncryption' => new sfValidatorPass(array('required' => false)),
      'MemberID'           => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
    ));

    $this->widgetSchema->setNameFormat('memberpassword_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'memberpassword';
  }

  public function getFields()
  {
    return array(
      'ID'                 => 'Number',
      'ClassName'          => 'Enum',
      'Created'            => 'Date',
      'LastEdited'         => 'Date',
      'Password'           => 'Text',
      'Salt'               => 'Text',
      'PasswordEncryption' => 'Text',
      'MemberID'           => 'Number',
    );
  }
}
